package com.qaml.mes.device.repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qaml.mes.device.dao.CheckUpkeepInfoDO;
import com.qaml.mes.device.dto.eqp.CheckUpkeepInfoDTO;
import com.qaml.mes.device.dto.eqp.CheckUpkeepInfoListDTO;

import java.util.List;

/**
 * @ClassName CheckUpkeepInfoRepository
 * @Description
 * @Author leikai
 * @Date 2024/2/27 0027 9:47
 * @Version 1.0
 */
public interface CheckUpkeepInfoRepository {

    /**
     * 根据id更新
     *
     * @param checkUpkeepInfoDO
     */
    void update(CheckUpkeepInfoDO checkUpkeepInfoDO);

    void save(CheckUpkeepInfoDO checkUpkeepInfoDO);

    /**
     * 根据检保编号查询检保项目
     *
     * @return
     */
    CheckUpkeepInfoDO getBycheckUpkeepId(String checkUpkeepId);


    CheckUpkeepInfoDO getById(String checkUpkeepId);

    /**
     * 分页列表查询
     *
     * @param page
     * @param pageSize
     * @param checkUpkeepInfoListDTO
     * @return
     */
    IPage<CheckUpkeepInfoDO> page(Integer page, Integer pageSize, CheckUpkeepInfoListDTO checkUpkeepInfoListDTO);


    /**
     * 根据设备id和状态查询
     *
     * @param eqpId
     * @param type
     * @return
     */
    List<CheckUpkeepInfoDO> getByEqpIdAndStatus(String eqpId, Integer type);


    List<CheckUpkeepInfoDO> getByEqpIdAndParams(String eqpId, CheckUpkeepInfoDO params);

    /**
     * 根据id和状态查询
     *
     * @param id
     * @param status
     * @return
     */
    CheckUpkeepInfoDO getByIdAndStatus(String id, Integer status);

    /**
     * 根据检保类型查询
     *
     * @param type
     * @return
     */
    List<CheckUpkeepInfoDO> getCheckUpkeepInfoDOByType(String type);

    List<CheckUpkeepInfoDO> getCheckUpkeepInfoDOByTypeAndCycle(String type, String cycle);

    /**
     * 根据设备id查询检保项目
     *
     * @param eqpId
     * @return
     */
    List<CheckUpkeepInfoDO> getByEqpId(String eqpId);

    /**
     * 根据设备id更新检保项目
     *
     * @param checkUpkeepInfoDOS
     */

    void updateByEqpId(List<CheckUpkeepInfoDO> checkUpkeepInfoDOS);

    void deleteById(String id);
}